Markup documents have simplified the creation of resources while at the same time improving their usability. Markup languages, such as extensible markup language (XML), are relatively easy to understand, which makes the creation of markup documents relatively simple. The use of XML technology has expanded beyond browser applications to database, operating system and other applications.
In many applications, much of the code pertains to creating and updating the User Interface (UI) of the application. Recently, many developers have learned to write (and some developers prefer to define) an application's UI by using markup languages, such as XML-based markup languages, etc. One example of an XML-based markup language is the “Extensible Application Markup Language (XAML).” XAML is a declarative programming model which maps XML markup to objects. XAML provides a consistent model for object construction, which can allow programmers to encode operating system, application and other elements in an object-rooted hierarchical format. XAML is especially useful for implementing an application's UI since XAML separates UI design from the underlying code. XAML allows a UI to be declaratively represented or specified as a hierarchy of objects with properties and logic. This enables graphical designers to create compelling, highly refined user interfaces, while allowing developers to focus on the application logic.
XML-based representations of documents or objects are typically larger than other formats, such as binary files or others. As such, XML/XAML-based data may demand significant amounts of time to load onto a client machine or download over a network. Techniques which make the XML/XAML-based platforms more efficient in storage and reduce application load times are highly desirable. To help achieve this, at compilation-time, XAML can be compiled into a binary representation of the XML.
In one resource model, a presentation framework has objects with a Resources property that can refer to resources in large files that contain resource dictionaries (RDs). A resource dictionary (RD) can include various resources which are defined in markup. In this context, the term “resource” refers to a way of reusing commonly defined objects and values. RDs allow developers to create one instance of a piece of data, in either markup or code, and re-use that data by referring to it from one or more locations within an element tree. RDs are used to store large amounts of data in random access memory (RAM) that may not be needed or used immediately. When a RD is specified, the entire RD and all resources in that RD would be created or “instantiated” at the same time. Instantiating and loading all of this data into RAM unnecessarily consumes valuable space in the memory and can, for example, increase application startup time.